<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <button>点击</button>
    <script>
        let button = document.querySelector("button")
        button.onclick=function(){
            console.log(this); //this指向button
        }
        console.log(Number("100ab")); //参数里面只能有数字
        console.log("100"/2);
        console.log("121"+2); //"121"+"2"
        console.log("北京"+2); //字符串和数字相加，把数字转化成字符串

        /**
         * 三元运算符
        */
       var isOpen = false  //是否开门
       var str = ""
       
       if(isOpen){
        str = "欢迎光临"
       }else{
        str = "休业整顿"
       }
    </script>
</body>
</html>